1. Field of the Present Invention
The present invention generally relates to the field of computer systems and more particularly to restoring functionality to a system after critical portions of the system""s boot code have been corrupted.
2. History of Related Art
Computer system architectures typically utilize a flash memory module to store the initial program load code. The initial program load code, also referred to in this disclosure as the boot code, is the first code to be executed by the system following a system reset. The boot code is *responsible for initializing and configuring many of the computer system""s operational parameters. Flash memory modules are popular for storing the boot code because they provide the combined advantage of non-volatility and easy programmability. Non-volatility is required for flash code storage since the flash code must be available when power is restored. Programmability is also highly desirable because flash codes are typically updated or otherwise altered after the computer system has been shipped. When a revised version of the flash code is available, a user of the computer system can download the updated flash code and reprogram the flash memory module with the updated code. Typically, the code responsible for reprogramming the flash memory module is stored in the flash memory itself. Conventional flash memory devices are divided into smaller blocks frequently referred to as sectors, wherein each sector is individually erasable (i.e., Sector A may be erased without erasing the contents of Sectors B, C, etc.). Typically, a base or initial sector is programmed with a core portion of the boot code referred to herein as the boot block or gold code. The gold code typically includes the initialization and configuration code referred to above in addition to the code required to download and update the remaining sectors of the flash module. It will be appreciated that any code residing in the same sector as the gold code cannot be reprogrammed without erasing the gold code itself. For this reason, it is highly desirable to locate the majority of the flash code in sectors of the flash memory module other than the gold code sector whereas the gold code it best suited for only highly essential and stable code. When this convention is followed, updating the gold code should be an extremely rare event.
Unfortunately, flash memory devices are susceptible to corruption for a variety of reasons. Assuming that the likelihood of any sector in a flash memory device becoming corrupted is essentially the same, it will be appreciated that most, but not all, errors that occur in the flash module are recoverable. More specially, if any sector of the flash module other than the sector containing the gold code becomes corrupted, the corruption is non-fatal since the gold code contains sufficient functionality to reprogram the remaining sectors of the flash module. If, however, the gold code sector is corrupted the error is fatal since the module will be unable to reprogram itself. The flash memory module is typically soldered directly to the motherboard of the computer system to avoid the unnecessary cost and complexity associated with adding a socket to the motherboard. This is especially true in the case of commercially distributed flash memory devices, which are typically packaged in BGA or SOP packages that are difficult and costly to socket. When the gold code sector of a flash memory module that is affixed to the motherboard becomes corrupted, the motherboard must usually be returned to the manufacturer for replacement of the flash module. The cost and time associated with repairing a corrupt flash module in this fashion is typically unacceptable. Accordingly, it would be highly desirable to address the problem of recovering from a corrupt gold code sector in a flash memory module without significantly increasing the cost or complexity of the overall system.
The problems identified above are in large part addressed by incorporating a backup storage element into the design of the system motherboard. The backup storage element contains sufficient code to reprogram the gold code in the primary storage element. When critical sections of the primary storage element become corrupted, the system is configured to execute the code stored in the backup element thereby restoring the primary storage element to a minimum level of functionality sufficient to enable the system to download remaining portions of the boot code into the primary storage element.
Broadly speaking the present invention contemplates a computer system and its associated motherboard. The system includes a central processing unit and a system memory that is accessible to the central processing unit via a host bus. The system further includes a bus bridge coupled between the host bus and an I/O bus and one or more I/O peripheral device coupled to the I/O bus. A primary non-volatile storage element and a backup non-volatile storage element are incorporated into the system""s motherboard. The primary non-volatile storage element contains the system""s boot code that is executed following a reset or power on event. The backup non-volatile storage element contains a restoration sequence that is suitable for reprogramming a first portion of the boot code in the primary non-volatile storage element. A jumper block on the motherboard determines which of the non-volatile storage elements is initially addressed following a power on event.
Preferably, the first portion of the boot code comprises the system""s boot block or gold code and includes a sequence for downloading and reprogramming remaining portions of the boot code. The primary non-volatile storage element is preferably implemented as a multiple sector flash memory device or module suitable for its programmability and non-volatility. In one embodiment, the gold code is stored in a first sector of the flash module while remaining portions of the boot code (referred to herein as the update code) are stored in remaining sectors. Preferably, the restoration sequence of the backup non-volatile storage element includes code sufficient to reprogram the gold code portion of the primary non-volatile storage element. In one embodiment desirable for its low cost and reliability, the backup non-volatile storage element comprises a conventional, mask-programmed ROM preferably packaged in a low cost, low profile package such as a PLCC. The ROM device may be housed in a socket to provide field interchangeability. In one embodiment, the backup non-volatile storage device includes a compressed copy of the first portion of the boot code and a decompression algorithm that is adapted to unpack the compressed copy of the first portion and program or store the decompressed code in the primary non-volatile storage element.
The present invention further contemplates a method of restoring a corrupted flash memory module in a computer system. After determining that a flash memory module is corrupted and shutting off the main system power, a setting on a motherboard of a computer is altered to indicate that the flash module needs to be restored. After power is restored to the system, the altered motherboard setting is detected thereby causing the system to execute a restoration sequence stored in a backup non-volatile storage element. The restoration sequence restores a first portion of the flash memory. Preferably, the step of altering the motherboard setting is accomplished by reconfiguring a jumper setting on the motherboard to indicate the backup non-volatile storage element as containing the first address location executed by the computer system following a power on event. In one embodiment, the step of restoring the first portion of the flash memory module comprises programming an initial sector of the flash memory module with the system""s gold code. The restoration of the initial sector is preferably achieved by decompressing a compressed copy of a the system""s gold code stored in the backup storage element and programming the initial sector of the flash module with the gold code. The method may further include the step of using the restored first portion of the flash memory module to restore remaining portions of the flash memory module such that, once the initial sector has been restored, the flash module is capable of downloading and restoring the remaining portions of its code.